package org.judo.admin.identity;

import org.judo.propertyobject.PropertyObject;
import java.util.*;

public class Role extends PropertyObject 
{
	private int active;
	private String rolename;
	private int roleid;
	
	private ArrayList userRoleChildren = new ArrayList();

	public void assignUserToRole(int userid)
	{
		userRoleChildren.add(new UserRole(userid,roleid));
	}
	
	public void assignUserToRole(AppUser user)
	{
		userRoleChildren.add(new UserRole(user.getUserid(),roleid));
	}
	
	public void removeUserFromRole(UserRole userRole)
	{
		userRoleChildren.remove(userRole);
	}
	
	public void setActive(int active) 
	{
		this.active = active;
	}

	public int getActive() 
	{
		return this.active;
	}

	public void setRolename(String rolename) 
	{
		this.rolename = rolename;
	}

	public String getRolename() 
	{
		return this.rolename;
	}

	public void setRoleid(int roleid) 
	{
		this.roleid = roleid;
	}

	public int getRoleid() 
	{
		return this.roleid;
	}

	public ArrayList getUserRoleChildren()
	{
		return userRoleChildren;
	}

	public void setUserRoleChildren(ArrayList userRoleChildren)
	{
		this.userRoleChildren = userRoleChildren;
	}
}
